<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
//=============================================================//
//Query File for Modules (BigDaddy v2)
//Duleepa Wijyawardhana, 25.03.2004
//=============================================================//

switch($_REQUEST["action"])
{
    case "addmod":
		$aInfo["name"] = $_POST["name"];
		$aInfo["filename"] = $_POST["filename"];
		$aInfo["runfrom"] = $_POST["runfrom"];
		$aInfo["distribute"] = $_POST["distribute"];
		$aInfo["type"] = $_POST["type"];
		$BigDaddyControl->SetModule($aInfo);
		$redirectTo="page=MonModules";
        break;
    case "editmod":
		$aInfo["name"] = $_POST["name"];
		$aInfo["filename"] = $_POST["filename"];
		$aInfo["runfrom"] = $_POST["runfrom"];
		$aInfo["distribute"] = $_POST["distribute"];
		$aInfo["type"] = $_POST["type"];
		
		$BigDaddyControl->SetModule($aInfo, $_POST["modID"]);
		$redirectTo="page=MonModules";
        break;
    case "deletemod":
		$BigDaddyControl->RemoveModule($_REQUEST["modID"]);
		$redirectTo="page=MonModules";
        break;
}

if ($redirectTo!="")
{
    header("Location: /index.html?".$redirectTo);
    exit;
}
else
{
    header("Location: /index.html");
    exit;
}

?>
